#ifndef DRAGGABLEBUTTON_H
#define DRAGGABLEBUTTON_H

#include <QMouseEvent>
#include <QObject>
#include <QPoint>
#include <QPushButton>

class DraggableButton : public QPushButton
{
    Q_OBJECT
public:
    DraggableButton(const QString &text, QWidget *parent = nullptr);

    ~DraggableButton();

signals:
    void doubleClicked();

protected:
    void mousePressEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    void mouseDoubleClickEvent(QMouseEvent *event) override;

private:
    QPoint m_dragStartPosition;
};

#endif // DRAGGABLEBUTTON_H
